[!note]
This is automated using the mechanized-aur ansible playbook
Building AUR packages into a repository, managed using the aurutils suite of tools.
Define the place where the repository is to be located
Add a new entry into the system pacman.conf to store the compiled packages:
[aether-aur]
SigLevel = Optional TrustAll
Server = file:///srv/arch-repos/aether-aur
Make sure the directory exists, and that your local user (who is running the aur tools) owns the directory.
Then initialize the repository with an empty database file, which can be represented as a 0 byte file:
touch /srv/arch-repos/aether-aur/aether-aur.db
Make a chroot config file
Install devtools and copy the configuration file that’ll be read by the chroot subcommand:
sudo cp /usr/share/devtools/pacman-extra.conf /usr/share/devtools/pacman-aur.conf
And then add the same repo configuration from above so that the local repo gets bind-mounted. (This way, AUR packages that depend on other AUR packages work.)
Do your first package:
aur sync -c --no-view neovim-git
The -c flag says to use a chroot (managed by systemd-nspawn)
The --no-view flag says to not require the user to check the contents of the AUR package. Only do this for trusted PKGBUILDs!
It’ll fail after it finishes building the package.
Actually make the real package database
Now you can delete the fake database, and build a real one.
cd /srv/arch-repos/aether-aur/
rm aether-user.db
repo-add aether-aur.db.tar.zst neovim-git-*
So now pacman -Sy and it should Just Work.